package demo.model.bean;

/**
 * @author   zkessentials store  This class provides a representation of a   {@code   CartItem}  
 */
public class CartItem {

	/**
	 * @uml.property  name="product"
	 * @uml.associationEnd  
	 */
	private Product product;
	/**
	 * @uml.property  name="amount"
	 */
	private int amount;

	public CartItem(Product product) {
		super();
		this.product = product;
	}

	/**
	 * @return
	 * @uml.property  name="product"
	 */
	public Product getProduct() {
		return product;
	}

	/**
	 * @return
	 * @uml.property  name="amount"
	 */
	public int getAmount() {
		return amount;
	}

	public void add(int amount) {
		this.amount += amount;
	}

	public float getSubTotal() {
		return product.getPrice() * amount;
	}
}
